int searchInsert(int* nums, int numsSize, int target) {
    int head = 0, rear = numsSize - 1; int pos = numsSize;
    while (head <= rear)
    {
        int mid = (head + rear) / 2;
        if (target > nums[mid])
        {

            head = mid + 1;
        }
        else
        {
            pos = mid;
            rear = mid - 1;
        }
    }
    return pos;
}
